//
//  RechargeCell.m
//  AnnCar_user
//
//  Created by LiBenCan on 17/10/25.
//  Copyright © 2017年 LiBenCan. All rights reserved.
//

#import "RechargeCell.h"
#import "UILabel+HWDUILabel.h"
@implementation RechargeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = 0;
        [self creatUI];
    }
    return self;
}

//创建视图
- (void)creatUI
{
    if (!_imageV) {
        //充值图片
         _imageV = [TomamaUI createImageView:CGRectMake(18*screenW_6, 25*screenW_6, 25*screenW_6, 25*screenW_6) backGroundImageV:@"recharge"];
        [self.contentView addSubview:_imageV];
        
        //充值赠送金额
        _rechargeLab = [TomamaUI createLabel:CGRectMake(CGRectGetMaxX(_imageV.frame)+15*screenW_6,0*screenW_6, SCREENW-100*screenW_6, 75*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:18*screenW_6] textColor:TextBlack text:@""];
        [self.contentView addSubview:_rechargeLab];
        
        //选择按钮
        _chooseImage = [TomamaUI createImageView:CGRectMake(SCREENW-30*screenW_6   ,30*screenW_6, 15*screenW_6, 15*screenW_6) backGroundImageV:@"circle"];
        [self.contentView addSubview:_chooseImage];
        
    }

}
//数据加载
-(void)setDataDic:(NSDictionary *)dataDic
{
    //充值金额
    _rechargeLab.text  = [NSString stringWithFormat:@"充%@  送%@元",[ToolViewVC getNotNullStr:@"100"],[ToolViewVC getNotNullStr:@"50"]];
    [_rechargeLab setHighlightStirng:[NSString stringWithFormat:@"送%@元",[ToolViewVC getNotNullStr:@"50"]] HighlightColor:TextGray];
    //图片展示 Choose：YES
    _chooseImage.image = [UIImage imageNamed:dataDic[@"isChoose"]?@"circle_select":@"circle"];
    
}
@end
